package cs.ni;

import java.net.InetAddress;

import cs.entity.UserFile;
import cs.remoteapp.Message;

/**
 * Describes all signals that can be sent and received by the remote application.<p>
 * Package  cs.ni
 * Project ChatSystemG1 - INSA 4INFOA1 - 2013/2014
 * @author Julie DUMONS & Juste OUEDRAOGO
 */
interface RemoteApp {


	/**
	 * send a hello message to the remote application which ip address = addr
	 * @param addr the Ip address of the remote application
	 * @param isBroadcast whether this message will be broadcast
	 */
	public void sendHello(InetAddress addr, boolean isBroadcast);
	

	/**
	 * send a goodbye message to the remote application 
	 */
	public void sendGoodbye();
	/**
	 * execute text message sending request
	 */
	public void sendTextMessage();

	/**
	 * execute file request sending request
	 * @param file concerned by the request
	 */
	public void sendFileRequest(UserFile file);

	/**
	 * Execute response to file request sending request
	 * @param file concerned by the answer
	 */
	public void sendFileAnswer(UserFile file);

	/**
	 * Execute file sending request
	 * @param file sended
	 */
	public void sendFile(UserFile file);

	/**
	 * Determine the type of a message and execute actions according to that type
	 * @param msg message to be processed
	 * @param addr ip address of the remote user (sender of the message)
	 */
	public void processReceive(Message msg, InetAddress addr);

}
